package com.longsec.qq.vo;

import lombok.Data;

/**
 * 验证二维码信息
 * @author 		Mr.Huang
 * @version		2019年12月4日
 */
@Data
public class VerifyVo {

	/**成功*/
	private static int CODE_SUCCESS = 2;
	/**等待扫描*/
	private static int CODE_DEFAULT = 0;
	/**验证中*/
	private static int CODE_VERIFY = 1;
	/**二维码过期*/
	private static int CODE_UPDATE = -1;
	private VerifyVo(int code){
		this.code = code;
	}
	private Integer code;
	
	private String url;
	
	private String qq;
	
	private String name;
	
	/**
	 * 登入成功
	 * @param url
	 * @return
	 */
	public static VerifyVo success(String url){
		VerifyVo verifyVo = new VerifyVo(CODE_SUCCESS);
		verifyVo.setUrl(url);
		return verifyVo;
	}
	
	/**
	 * 默认等待扫描
	 * @return
	 */
	public static VerifyVo defaults(){
		return  new VerifyVo(CODE_DEFAULT);
	}
	
	/**
	 * 身份认证中
	 * @return
	 */
	public static VerifyVo verify(){
		return  new VerifyVo(CODE_VERIFY);
	}
	
	/**
	 * 二维码过期
	 * @return
	 */
	public static VerifyVo update(){
		return  new VerifyVo(CODE_UPDATE);
	}
	
}
